package net.simflow.swf.analyzer.network.stats.data;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.TreeMap;

import net.simflow.swf.analyzer.network.data.Flow;
import net.simflow.swf.analyzer.network.data.Link;
import net.simflow.swf.analyzer.network.data.Network;
import net.simflow.swf.analyzer.network.data.Node;
import net.simflow.swf.analyzer.network.data.Service;

public class NetworkStats {
	public final static String NAME = "Name";
	public final static String FLOW = "Flows";
	public final static String NODE = "Nodes";
	public final static String SERVICE = "Service";
	public final static String LINK = "Link";
	public final static String DEGREE_DISTRIBUTION = "Degree Distribution";

	private Network network;
	private String networkName;
	private HashSet<Node> nodeSet;
	private HashSet<Flow> flowSet;
	private HashSet<Service> serviceSet;
	private HashSet<Link> linkSet;
	private TreeMap<Integer, ArrayList<Node>> degreeDistribution;

	public Network getNetwork() {
		return network;
	}

	public void setNetwork(Network network) {
		this.network = network;
	}

	public String getNetworkName() {
		return networkName;
	}

	public void setNetworkName(String networkName) {
		this.networkName = networkName;
	}

	public HashSet<Service> getServiceSet() {
		return serviceSet;
	}

	public void setServiceSet(HashSet<Service> serviceSet) {
		this.serviceSet = serviceSet;
	}

	public HashSet<Flow> getFlowSet() {
		return flowSet;
	}

	public void setFlowSet(HashSet<Flow> flowSet) {
		this.flowSet = flowSet;
	}

	public HashSet<Node> getNodeSet() {
		return nodeSet;
	}

	public void setNodeSet(HashSet<Node> nodeSet) {
		this.nodeSet = nodeSet;
	}

	public HashSet<Link> getLinkSet() {
		return linkSet;
	}

	public void setLinkSet(HashSet<Link> linkSet) {
		this.linkSet = linkSet;
	}

	public int getNodeCount() {
		if (nodeSet == null) {
			return -1;
		}
		return nodeSet.size();
	}

	public int getLinkCount() {
		if (linkSet == null) {
			return -1;
		}
		return linkSet.size();
	}

	public int getServiceCount() {
		if (serviceSet == null) {
			return -1;
		}
		return serviceSet.size();
	}

	public int getFlowCount() {
		if (flowSet == null) {
			return -1;
		}
		return flowSet.size();
	}

	public TreeMap<Integer, ArrayList<Node>> getDegreeDistribution() {
		return degreeDistribution;
	}

	public void setDegreeDistribution(
			TreeMap<Integer, ArrayList<Node>> degreeDistribution) {
		this.degreeDistribution = degreeDistribution;
	}
}
